<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateExternalPriceBreakdownTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('external_price_breakdown', function(Blueprint $table)
		{
			$table->increments('id');
			$table->integer('cost');
			$table->string('project_no')->nullable();
			$table->string('customer_model_number')->nullable();
			$table->integer('jenkins_model_number')->nullable();
			$table->string('customer_assembly_number')->nullable();
			$table->string('jenkins_assembly_number')->nullable();
			$table->string('customer_part_number')->nullable();
			$table->string('jenkins_part_number')->nullable();
			$table->string('customer_drawing_number')->nullable();
			$table->string('revision1')->nullable();
			$table->integer('jenkins_drawing_number')->nullable();
			$table->string('revision2')->nullable();
			$table->float('material', 10, 0)->nullable();
			$table->string('additional_material_specification', 45)->nullable();
			$table->dateTime('finish')->nullable();
			$table->float('material_cost', 10, 0)->nullable();
			$table->string('material_cost_currency', 3)->nullable()->default('RMB');
			$table->float('assembly_cost', 10, 0)->nullable();
			$table->string('assembly_cost_currency', 3)->nullable()->default('RMB');
			$table->float('overhead', 10, 0)->nullable();
			$table->string('overhead_currency', 3)->nullable()->default('RMB');
			$table->float('factory_profit', 10, 0)->nullable();
			$table->string('factory_profit_currency', 3)->nullable()->default('RMB');
			$table->float('tax', 10, 0)->nullable();
			$table->string('tax_currency', 3)->nullable()->default('RMB');
			$table->float('customs', 10, 0)->nullable();
			$table->string('customs_currency', 3)->nullable()->default('RMB');
			$table->float('freight', 10, 0)->nullable();
			$table->string('freight_currency', 3)->nullable()->default('RMB');
			$table->float('handling', 10, 0)->nullable();
			$table->string('handling_currency', 3)->nullable()->default('RMB');
			$table->float('internal_budgetary_price', 10, 0)->nullable();
			$table->string('internal_budgetary_price_currency', 3)->nullable()->default('RMB');
			$table->string('currency', 3)->nullable()->default('RMB');
			$table->integer('approved')->nullable()->default(0);
			$table->integer('Published')->nullable()->default(0);
			$table->integer('valid')->nullable()->default(1);
			$table->timestamps();
			$table->softDeletes();
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('external_price_breakdown');
	}

}
